DigestLength = 50
BUFFER_SIZE = 4096
EXPIRES_TIME = 1000
AUTH_CACHE_FLUSH_TIME = 100
AUTH_EXPIRE_TIME = 1000

DAV_SUPPORT_PROPERTY_LIST = ['creationdate',
                             'displayname',
                             'getcontentlanguage',
                             'getcontentlength',
                             'getcontenttype',
                             'getetag',
                             'getlastmodified',
                             'lockdiscovery',
                             'resourcetype',
                             'supportedlock',
                             'owner',
                             'group',
                             'group-member-set',
                             'group-membership',
                             'acl']

DAV_SUPPORT_PRIVILEGE_LIST = ['read',
                              'write',
                              'write-properties',
                              'write-content',
                              'unlock',
                              'read-acl',
                              'read-current-user-privilege-set',
                              'write-acl',
                              'bind',
                              'unbind',
                              'all']

DAV_ERROR_TAG_LIST = ['lock-token-submitted',
                      'need-privileges',]

# Request classes in propfind
RT_ALLPROP=1
RT_PROPNAME=2
RT_PROP=3

DAV_VERSION_1 = {
    'version' : '1',
    'options' : 
    'GET, HEAD, COPY, MOVE, POST, PUT, PROPFIND, PROPPATCH, OPTIONS, MKCOL, DELETE, REPORT' # , TRACE
    }
DAV_VERSION_2 = {
    'version' : '1,2',
    'options' : 
    DAV_VERSION_1['options'] + ', LOCK, UNLOCK'
    }

SUPPORT_PROPNAMES = {'Creation-Date':'creationdate',
                     'Display-Name':'displayname',
                     'Content-Length':'getcontentlength',
                     'Content-Type':'getcontenttype',
                     'Tag':'gettag',
                     'Last-Modified':'getlastmodified',
                     'Resource-Type':'resourcetype',
                     'Support-Lock':'supportedlock',
                     }

INIT_ACL = {
    'MKCOL':'''
<ns0:acl xmlns:ns0="DAV:">
  <ns0:ace>
    <ns0:principal>
      <ns0:property><ns0:owner /></ns0:property>
    </ns0:principal>
    <ns0:grant>
      <ns0:privilege><ns0:all /></ns0:privilege>
    </ns0:grant>
  </ns0:ace>
</ns0:acl>
''',
    'PUT':'''
<ns0:acl xmlns:ns0="DAV:">
  <ns0:ace>
    <ns0:principal>
      <ns0:property><ns0:owner /></ns0:property>
    </ns0:principal>
    <ns0:grant>
      <ns0:privilege><ns0:all /></ns0:privilege>
    </ns0:grant>
  </ns0:ace>
</ns0:acl>
'''
    }